package com.example.demo.mapper;

import com.example.demo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: ling
 * Date: 2023-02-14
 * Time: 11:56
 */
@Mapper
public interface ArticleMapper {

    public List<ArticleInfo> getMyList(@Param("uid") Integer uid);

    public ArticleInfo getDetail(@Param("aid") Integer aid);

    public Integer artDel(@Param("aid") Integer aid);

    public int rcountAdd(@Param("aid") Integer aid,@Param("rcount") Integer rcount);

    public int update(@Param("aid") Integer aid,@Param("uid") Integer uid,
                      @Param("title") String title,@Param("content") String content);

    public int releaseArt(@Param("title")String title,@Param("content") String content,@Param("uid") Integer uid);

    public int draftArt(@Param("title") String title,@Param("content") String content,
                        @Param("uid") Integer uid,@Param("state") Integer state);

    public int publishArt(@Param("aid") Integer aid,@Param("state") Integer state);

    public int getTotalCount();

    public List<ArticleInfo> getList(@Param("psize") Integer psize,@Param("offset") Integer offset);
}
